﻿using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;

namespace Quantum.Logging
{
   public static class SqlServerLoggerExtensions
    {
        public static ILoggingBuilder AddSqlServer(this ILoggingBuilder builder, Action<SqlServerLoggerOptions> configure)
        {
            builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<ILoggerProvider, SqlServerLoggerProvider>());
            builder.Services.Configure(configure);
            return builder;
        }
    }
}
